package com.semanticweb.webapp.dao.rbac;

import org.hibernate.criterion.Restrictions;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.semanticweb.webapp.model.rbac.Role;

@Repository
@Transactional
public class RoleDAOHibernate extends AbstractGenericHibernateDao<Role> implements
		RoleDAO {

	@Override
	public Role findByName(@NotBlank final String roleName) {
		return findByCriteriaUnique(Restrictions.eq(Role.ROLE_NAME, roleName));
	}

}
